from enum import IntFlag

class Perm(IntFlag):
    R = 1
    W = 2
    X = 4
RW = Perm.R | Perm.W
RW_2 = Perm.R + Perm.W

if RW == 3:
    print("RW == 3")
if RW_2 == 3:
    print("RW_2 == 3")
else:
    print("not RW")

# 运行结果:
# RW == 3
# RW_2 == 3